package com.exrobot.module.rbt.dal.mysql.canteeninfo;

import java.util.*;

import com.exrobot.framework.common.pojo.PageResult;
import com.exrobot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.exrobot.framework.mybatis.core.mapper.BaseMapperX;
import com.exrobot.module.rbt.dal.dataobject.canteeninfo.CanteenInfoDO;
import org.apache.ibatis.annotations.Mapper;
import com.exrobot.module.rbt.controller.admin.canteeninfo.vo.*;

/**
 * 食堂信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface CanteenInfoMapper extends BaseMapperX<CanteenInfoDO> {

    default PageResult<CanteenInfoDO> selectPage(CanteenInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CanteenInfoDO>()
                .likeIfPresent(CanteenInfoDO::getName, reqVO.getName())
                .eqIfPresent(CanteenInfoDO::getManager, reqVO.getManager())
                .eqIfPresent(CanteenInfoDO::getMail, reqVO.getMail())
                .eqIfPresent(CanteenInfoDO::getPhone, reqVO.getPhone())
                .eqIfPresent(CanteenInfoDO::getAddress, reqVO.getAddress())
                .eqIfPresent(CanteenInfoDO::getImg, reqVO.getImg())
                .eqIfPresent(CanteenInfoDO::getInfo, reqVO.getInfo())
                .eqIfPresent(CanteenInfoDO::getPoint, reqVO.getPoint())
                .betweenIfPresent(CanteenInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(CanteenInfoDO::getSort));
    }

}